import { datashopAxios } from '@/utils/request'

// 列表
export const reqMapList = (params: any): Promise<any> => {
  return datashopAxios({
    url: '/api/datashop/v3/industry-dws',
    method: 'get',
    params
  })
}
// 新增
export const reqDataMapAdd = (data: any): Promise<any> => {
  return datashopAxios({
    url: '/api/datashop/v3/industry-dws',
    method: 'post',
    data
  })
}
// 编辑
export const reqDataMapEdit = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dws/${data.id}`,
    method: 'put',
    data
  })
}
// 下架
export const reqRevokeDataMap = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dws/${data.id}:revoke`,
    method: 'post',
    data
  })
}
// 创建产业图谱审批
export const reqPublishDataMap = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dw-audits`,
    method: 'post',
    data
  })
}
// 上移数据
export const moveUpDataMap = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dws/${data.id}:move-up`,
    method: 'post',
    data
  })
}
// 下移数据
export const moveDownDataMap = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dws/${data.id}:move-down`,
    method: 'post',
    data
  })
}
// 删除
export const reqDeleteDataMap = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dws/${data.id}`,
    method: 'delete',
    data
  })
}

// 详情
export const reqMapInfor = (params: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dws/${params.id}`,
    method: 'get',
    params
  })
}

// 审批通过
export const reqApproveDataMapAudit = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dw-audits/${data.id}:approve`,
    method: 'post',
    data
  })
}
// 驳回
export const reqRejectDataMap = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-dw-audits/${data.id}:reject`,
    method: 'post',
    data
  })
}

// 图谱下拉列表
export const getAllMapOptions = (params: any): Promise<any> => {
  return datashopAxios({
    url: '/api/datashop/v3/industry-maps',
    method: 'get',
    params
  })
}
